/* GUI CONVERTED from rcsdpntb.p (converter v1.76) Sun Feb 24 20:08:37 2002 */
/* rcsdpntb.p - Release Management Customer Schedules                       */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                      */
/* All rights reserved worldwide.  This is an unpublished work.             */
/* $Revision: 1.6 $                                                            */
/*V8:ConvertMode=Maintenance                                                */
/* REVISION: 7.3    LAST MODIFIED: 01/05/93           BY: WUG *G462*        */
/* REVISION: 8.6    LAST MODIFIED: 05/20/98           BY: *K1Q4* Alfred Tan */
/* REVISION: 9.1    LAST MODIFIED: 08/12/00           BY: *N0KP* myb        */
/* Old ECO marker removed, but no ECO header exists *F0PN*                  */
/* $Revision: 1.6 $    BY: Anitha Gopal          DATE: 02/17/02  ECO: *N19G*  */
/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/

/* INTERPRETS SHIP/DELIVERY PATTERN CODE SUBROUTINE
DETERMINES SHIP DATES BASED ON THE WEEK START OFFSET, THE DAYS OF
THE   WEEK  TO  SHIP,  AND  THE  WEEK  MONDAY  DATE.   THE  FIELD
days_of_week IS A 7-BYTE CHAR FIELD WHERE EACH  BYTE  CORRESPONDS
TO  MONDAY-SUNDAY.  IF THE BYTE IS "X" THEN THE DAY IS TO BE USED
FOR A SHIP DATE.  */

{mfdeclre.i}

/* INPUT PARAMETERS: */
define shared variable week_offset as integer.
define shared variable days_of_week as character.
define shared variable wk_mon_dt as date.

/* OUTPUT PARAMETERS: */
define shared variable resch_ct as integer.
define shared variable resch_dt as date extent 999 no-undo.

define variable i as integer no-undo.
define variable j as integer no-undo.
define variable work_dt as date.

assign
   work_dt = wk_mon_dt + week_offset
   resch_ct = 0.

do i = 1 to length(days_of_week):
   j = ((i + week_offset - 1) modulo 7) + 1.
   if substring(days_of_week,j,1) = "x"
   then
      assign
         resch_ct = resch_ct + 1
         resch_dt[resch_ct] = work_dt.

   work_dt = work_dt + 1.
end. /* DO i = 1 TO length(days_of_week) */
